<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>angular的遍历显示集合数据</title>
		<script type="text/javascript" src="../js/angular.min.js">
			
		</script>
	</head>
	<!--ng-app是angular编程的接口，是模块作用域-->
	<body  ng-app="myapp" ng-controller="mys">
		<table width="100%" border="1">
			<tr>
			<th>序号</th>
			<th>编号</th>
			<th>名称</th>
			<th>价格</th>
			</tr>
			<tr ng-repeat="product in products">
				<th>{{$index+1}}</th>
				<th>{{product.id}}</th>
				<th>{{product.name}}</th>
				<th>{{product.price}}</th>
			</tr>
		</table>
		<script type="text/javascript">
			var myapp= angular.module("myapp",[]);
			myapp.controller("mys",["$scope",function($scope){
				$scope.products=[
				{
					id:111,
					name:'电视机',
					price:5555
				},{
					id:121,
					name:'电冰箱',
					price:5655
				},{
					id:131,
					name:'电脑',
					price:8555
				}];
			}])
		</script>
	</body>
</html>
